<?php 
class boutique_models_show extends CI_Model{
   
    public function get_id_from_link($link){
    	$this->load->database();
    	$get= $this->db->get_where('shop',array('shop_active'=>1,'shop_link'=>$link),1);
    	if($get->num_rows()){
    		$row= $get->result();
    		return $row[0]->id;
    	}
    	return false;
    }
    public function active_id_from_link($link){
    	$this->load->database();
    	$get= $this->db->get_where('shop',array('shop_link'=>$link),1);
    	if($get->num_rows()){
    		$this->db->update('shop', array('shop_active'=>1),array('shop_link'=>$link));
    		$row= $get->result();
    		return $row[0]->id;
    	}
    	return false;
    }
}